﻿@using RoadFlow.Utility;
@using RoadFlow.Business;
@using Microsoft.AspNetCore.Http;
@{
	var Request = (HttpRequest)ViewData["request"];
	string instanceId = Request.Querys("instanceid");
	string taskId = Request.Querys("taskid");
	string stepId = Request.Querys("stepid");
	string flowId = Request.Querys("flowid");
	string display = Request.Querys("display");
	bool showArchive = "1".Equals(Request.Querys("showarchive"));
	string fieldStatusJSON = string.Empty;
	string formData = showArchive ? new FlowArchive().GetArchiveData(Request.Querys("archiveid").ToGuid()) : new Form().GetFormData("dba78397-b5df-4145-87af-cb8b5d0655d7", "RF_Test", "Id", instanceId, stepId, flowId, "[{'id':'RF_TEST-F11','type':'datetime','format':'yyyy-MM-dd'}]", out fieldStatusJSON);
}
<script type="text/javascript" src="~/RoadFlowResources/scripts/flowRun/form.js"></script>
<script type="text/javascript">
	var formDataJSON = @Html.Raw(formData.IsNullOrWhiteSpace() ? "[]" : formData);
	var fieldStatusJSON = @Html.Raw(fieldStatusJSON.IsNullOrWhiteSpace() ? "[]" : fieldStatusJSON);
	var defaultValuesJSON = @Html.Raw(new Form().GetDefaultValuesJSON("[{'id':'RF_TEST-F1','value':'{<UserName>}---{<UserDeptName>}---{<UserUnitName>}'},{'id':'RF_TEST-F7','value':'{<UserWorkGroupId>}'},{'id':'RF_TEST-F10','value':'{<UserName>}'},{'id':'RF_TEST-F12','value':'u_{<UserId>}'}]", fieldStatusJSON));
	$(window).load(function () {
		formLoad.load(formDataJSON, fieldStatusJSON, "RF_Test", "@display", defaultValuesJSON);
	});
	function fun_event_D38E0C1D2FC5107B9D22D0B704D02148(srcElement){
		alert('a');
	}
</script>
<link href="~/RoadFlowResources/scripts/flowRun/common.css" rel="stylesheet" />
<input type="hidden" name="form_dbconnid" id="form_dbconnid" value="dba78397-b5df-4145-87af-cb8b5d0655d7"/>
<input type="hidden" name="form_dbtable" id="form_dbtable" value="RF_Test"/>
<input type="hidden" name="form_dbtableprimarykey" id="form_dbtableprimarykey" value="Id"/>
<input type="hidden" name="form_dbtabletitle" id="form_dbtabletitle" value="f1"/>
<input type="hidden" name="form_instanceid" id="form_instanceid" value="@instanceId"/>
<textarea style="display:none;" name="form_fieldstatus" id="form_fieldstatus">@Html.Raw(fieldStatusJSON.IsNullOrWhiteSpace() ? "[]" : fieldStatusJSON)</textarea>
<textarea style="display:none;" name="form_dataformatjson" id="form_dataformatjson">[{'id':'RF_TEST-F11','type':'datetime','format':'yyyy-MM-dd'}]</textarea>
<textarea style="display:none;" name="form_dbtabletitleexpression" id="form_dbtabletitleexpression">测试流程-{<FlowStepName>}-{f15}</textarea>
<p style="text-align: center;"><span style="font-size:20px;"><strong>控件测试</strong></span></p>

<table align="center" border="1" cellpadding="1" cellspacing="1" style="width:95%;">
	<tbody>
		<tr>
			<td style="width: 133px;">文本框：</td>
			<td style="width: 1404px;"><input data-isflow="1" data-type="text" data-valuetype="" id="RF_TEST-F1" name="RF_TEST-F1" style="width: 70%;" type="text" value="" class="mytext"></td>
		</tr>
		<tr>
			<td style="width: 133px;">文本域：</td>
			<td style="width: 1404px;"><textarea data-isflow="1" data-type="textarea" data-valuetype="" id="RF_TEST-F2" name="RF_TEST-F2" style="width: 70%; height: 50px;" placeholder="和" class="mytextarea"></textarea></td>
		</tr>
		<tr>
			<td style="width: 133px;">下拉选择：</td>
			<td style="width: 1404px;"><select data-isflow="1" data-linkage_field="RF_TEST-F4" data-type="select" id="RF_TEST-F3" name="RF_TEST-F3" style="" class="myselect" onchange="formLoad.loadChildOptions(this, 'RF_TEST-F4', 'dict', 'dba78397-b5df-4145-87af-cb8b5d0655d7', '', 'title', 'ed21bf40-6a85-45d5-aa6e-13ec81d66e88', '1', false, false);"><option value=""></option>@Html.Raw(new Dictionary().GetOptionsByID("ed21bf40-6a85-45d5-aa6e-13ec81d66e88".ToGuid(), Dictionary.ValueField.Title, "", false))</select>&nbsp; &nbsp; &nbsp;<select data-isflow="1" data-linkage_field="" data-type="select" id="RF_TEST-F4" name="RF_TEST-F4" style="" class="myselect"></select></td>
		</tr>
		<tr>
			<td style="width: 133px;">单选按钮：</td>
			<td style="width: 1404px;">@Html.Raw(new Form().GetRadioOrCheckboxHtml(0, "dba78397-b5df-4145-87af-cb8b5d0655d7", "ec3e6dd4-dfd6-4116-80c1-fb659289615f", "value", "", "", "radio", "RF_TEST-F5", "data-isflow=\"1\" data-type=\"radio\""))</td>
		</tr>
		<tr>
			<td style="width: 133px;">复选按钮：</td>
			<td style="width: 1404px;">@Html.Raw(new Form().GetRadioOrCheckboxHtml(0, "dba78397-b5df-4145-87af-cb8b5d0655d7", "ec3e6dd4-dfd6-4116-80c1-fb659289615f", "id", "", "", "checkbox", "RF_TEST-F6", "data-isflow=\"1\" data-type=\"checkbox\""))</td>
		</tr>
		<tr>
			<td style="width: 133px;">隐藏域：</td>
			<td style="width: 1404px;"><input data-isflow="1" data-type="hidden" id="RF_TEST-F7" name="RF_TEST-F7" style="color: rgb(153, 153, 153);" type="hidden" value=""></td>
		</tr>
		<tr>
			<td style="width: 133px;">按钮：</td>
			<td style="width: 1404px;">&nbsp;</td>
		</tr>
		<tr>
			<td style="width: 133px;">HTML编辑器：</td>
			<td style="width: 1404px;"><textarea data-isflow="1" data-type="html" id="RF_TEST-F9" name="RF_TEST-F9" style="width: 80%; height: 100px; color: rgb(153, 153, 153);" rows="1" cols="1"></textarea><script src="~/RoadFlowResources/scripts/ckeditor/ckeditor.js"></script><script>CKEDITOR.replace("RF_TEST-F9",{height:100,toolbarGroups:formLoad.ckeditor_toolbarFullGroups,filebrowserImageUploadUrl:"/RoadFlowCore/Controls/SaveCKEditorFiles"});</script></td>
		</tr>
		<tr>
			<td style="width: 133px;">LABEL标签：</td>
			<td style="width: 1404px;"><input type="hidden" id="RF_TEST-F10_hidden" name="RF_TEST-F10" value=""/><label data-isflow="1" data-type="label" data-bindfiled="RF_TEST-F10" id="RF_TEST-F10" style=""></label></td>
		</tr>
		<tr>
			<td style="width: 133px;">附件：</td>
			<td style="width: 1404px;"><input data-isflow="1" data-type="files" id="RF_TEST-F14" name="RF_TEST-F14" type="text" value="" class="myfile"></td>
		</tr>
		<tr>
			<td style="width: 133px;">日期时间：</td>
			<td style="width: 1404px;"><input data-isflow="1" data-type="datetime" id="RF_TEST-F11" name="RF_TEST-F11" style="" type="text" value="" class="mycalendar"></td>
		</tr>
		<tr>
			<td style="width: 133px;">组织架构：</td>
			<td style="width: 1404px;"><input data-isflow="1" data-type="organize" id="RF_TEST-F12" name="RF_TEST-F12" type="text" value="" class="mymember" rootid="09809cc7-d431-4cda-bc98-d0317a51c967" unit="0" dept="1" station="0" group="0" user="1" more="0"></td>
		</tr>
		<tr>
			<td style="width: 133px;">数据字典：</td>
			<td style="width: 1404px;"><input data-isflow="1" data-type="lrselect" id="RF_TEST-F13" name="RF_TEST-F13" type="text" value="" class="mydict" ismore="1" isroot="0" isparent="0" rootid="7f7aba94-8e5d-46e4-a0d2-2d8508b7e96e" ischild="1"></td>
		</tr>
		<tr>
			<td style="width: 133px;">流水号：</td>
			<td style="width: 1404px;"><input data-bindfiled="f15" data-isflow="1" data-type="serialnumber" id="RF_TEST-F15" name="RF_TEST-F15" style="width: 200px;" type="text" value="" placeholder="自动生成流水号" class="mytext" readonly=""><textarea style="width:0;height:0;display:none;" name="rf_serialnumber_config_RF_TEST-F15">{"maxfiled":"f16","length":"5","formatstring":"ROAD-{Date<yyyyMMdd>}-{SerialNumber}","sqlwhere":""}</textarea><input type="hidden" value="RF_TEST-F15" name="rf_serialnumber"></td>
		</tr>
		<tr>
			<td style="width: 133px;">子表：</td>
			<td style="width: 1404px;"><table data-isflowsubtable="1" width="95%" id="SUBTABLE_RF_TESTSUB-ID-ID-TESTID">
	<thead>
		<tr>
			<th>序号</th>
			<th>f1</th>
			<th>f2</th>
			<th>f3</th>
			<th>f4</th>
			<th>f5</th>
			<th>f6</th>
			<th width="120px" style="text-align:left;">
				<input type="hidden" name="SUBTABLE_id" value="RF_TESTSUB-ID-ID-TESTID"/>
				<input type="hidden" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_secondtable" value="RF_TestSub"/>
				<input type="hidden" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_primarytablefiled" value="Id"/>
				<input type="hidden" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_secondtableprimarykey" value="Id"/>
				<input type="hidden" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_secondtablerelationfield" value="TestId"/>
				<input type="button" value="添加" class="mybutton" onclick="formLoad.subtableAddRow('SUBTABLE_RF_TESTSUB-ID-ID-TESTID', $('#SUBTABLE_RF_TESTSUB-ID-ID-TESTID tbody tr:first'), true);"/>
			</th>
		</tr>
	</thead>
	<tbody>
		@{
		int subtableIndex_RF_TestSub_Id_Id_TestId = 1;
		System.Data.DataTable subtableMapList_RF_TestSub_Id_Id_TestId = new DbConnection().GetDataTable(new DbConnection().Get("dba78397-b5df-4145-87af-cb8b5d0655d7".ToGuid()), "RF_TestSub", "TestId", instanceId, "f1 asc");
		if(null == subtableMapList_RF_TestSub_Id_Id_TestId || subtableMapList_RF_TestSub_Id_Id_TestId.Rows.Count == 0)
		{
			subtableMapList_RF_TestSub_Id_Id_TestId = new System.Data.DataTable();
			subtableMapList_RF_TestSub_Id_Id_TestId.Rows.Add(subtableMapList_RF_TestSub_Id_Id_TestId.NewRow());
		}
		foreach(System.Data.DataRow dr in subtableMapList_RF_TestSub_Id_Id_TestId.Rows)
		{
			Object rowIndexObj = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("Id") ? dr["Id"] : null;
			string rowIndexStr = null == rowIndexObj ? Guid.NewGuid().ToString() : rowIndexObj.ToString();
			string value_f1 = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("f1") ? dr["f1"].ToString() : string.Empty;
			string value_f2 = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("f2") ? dr["f2"].ToString() : string.Empty;
			string value_f3 = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("f3") ? dr["f3"].ToString() : string.Empty;
			string value_f4 = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("f4") ? dr["f4"].ToString() : string.Empty;
			string value_f5 = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("f5") ? dr["f5"].ToString() : string.Empty;
			string value_f6 = subtableMapList_RF_TestSub_Id_Id_TestId.Columns.Contains("f6") ? dr["f6"].ToString() : string.Empty;
		<tr>
			<td data-tdindex="1" style="text-align:center;">@(subtableIndex_RF_TestSub_Id_Id_TestId++)</td>
			<td style="text-align:left;"><input type="text" value="@value_f1" data-isflow="1" data-issubtable="1" data-type="text" data-table="RF_TestSub" data-field="f1" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f1_@(rowIndexStr)" id="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f1_@(rowIndexStr)" class="mytext"/></td>
			<td style="text-align:left;"><input type="text" value="@value_f2" data-isflow="1" data-issubtable="1" data-type="text" data-table="RF_TestSub" data-field="f2" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f2_@(rowIndexStr)" id="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f2_@(rowIndexStr)" class="mytext"/></td>
			<td style="text-align:left;">@Html.Raw(new Form().GetRadioOrCheckboxHtml(0, "dba78397-b5df-4145-87af-cb8b5d0655d7", "fe8c335b-89a9-477f-93f1-4dff2dd507a4", "id", "", value_f3, "radio", "SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f3_" + rowIndexStr, "data-isflow=\"1\" data-type=\"radio\" data-table=\"RF_TestSub\" data-field=\"f3\" data-issubtable=\"1\" data-value=\""+value_f3+"\""))</td>
			<td style="text-align:left;">@Html.Raw(new Form().GetRadioOrCheckboxHtml(0, "dba78397-b5df-4145-87af-cb8b5d0655d7", "fe8c335b-89a9-477f-93f1-4dff2dd507a4", "value", "", value_f4, "checkbox", "SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f4_" + rowIndexStr, "data-isflow=\"1\" data-type=\"checkbox\" data-table=\"RF_TestSub\" data-field=\"f4\" data-issubtable=\"1\" data-value=\""+value_f4+"\" "))</td>
			<td style="text-align:left;"><select data-value="@value_f5" data-isflow="1" data-issubtable="1" data-type="select" data-table="RF_TestSub" data-field="f5" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f5_@(rowIndexStr)" id="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f5_@(rowIndexStr)" class="myselect">@Html.Raw(new Dictionary().GetOptionsByID("fe8c335b-89a9-477f-93f1-4dff2dd507a4".ToGuid(), Dictionary.ValueField.Value, value_f5))</select></td>
			<td style="text-align:left;"><input type="text" value="@value_f6" data-value="@value_f6" data-isflow="1" data-issubtable="1" data-type="files" data-table="RF_TestSub" data-field="f6" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f6_@(rowIndexStr)" id="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_f6_@(rowIndexStr)" class="myfile" style="width:100px;"/></td>
			<td><input type="hidden" name="SUBTABLE_RF_TESTSUB-ID-ID-TESTID_rowindex" value="@rowIndexStr"/><input type="button" value="插入" class="mybutton" onclick="formLoad.subtableAddRow('SUBTABLE_RF_TESTSUB-ID-ID-TESTID',$(this).parent().parent(), false);" style="margin-right:3px;"/><input type="button" class="mybutton" value="删除" onclick="formLoad.subtableDelRow($(this).parent().parent());"/></td>
		</tr>
		}
		}
	</tbody>
</table>
</td>
		</tr>
	</tbody>
</table>

<p>&nbsp;</p>
